package com.example.idachuappone.promptly.entity;

import java.io.Serializable;

import org.json.JSONObject;

public class Addresses implements Serializable {
	private String area;
	private String community;
	private String door_number;
	private String id;
	private String is_default;
	private String lat;
	private String lng;
	private String name;
	private String phone;

	public Addresses parseJson(JSONObject json) {
		if (json == null) {
			return null;
		}
		if (json.has("id")) {
			this.id = json.optString("id");
		}
		if (json.has("name")) {
			this.name = json.optString("name");
		}
		if (json.has("phone")) {
			this.phone = json.optString("phone");
		}
		if (json.has("is_default")) {
			this.is_default = json.optString("is_default");
		}
		if (json.has("area")) {
			this.area = json.optString("area");
		}
		if (json.has("community")) {
			this.community = json.optString("community");
		}
		if (json.has("door_number")) {
			this.door_number = json.optString("door_number");
		}
		if (json.has("lat")) {
			this.lat = json.optString("lat");
		}
		if (!json.has("lng")) {
			return this;
		}
		this.lng = json.optString("lng");
		return this;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getIs_default() {
		return this.is_default;
	}

	public void setIs_default(String is_default) {
		this.is_default = is_default;
	}

	public String getArea() {
		return this.area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getCommunity() {
		return this.community;
	}

	public void setCommunity(String community) {
		this.community = community;
	}

	public String getDoor_number() {
		return this.door_number;
	}

	public void setDoor_number(String door_number) {
		this.door_number = door_number;
	}

	public String getLat() {
		return this.lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	public String getLng() {
		return this.lng;
	}

	public void setLng(String lng) {
		this.lng = lng;
	}

	public Addresses(String id, String is_default, String name, String phone, String area, String community,
			String door_number, String lat, String lng) {
		this.id = id;
		this.is_default = is_default;
		this.name = name;
		this.phone = phone;
		this.area = area;
		this.community = community;
		this.door_number = door_number;
		this.lat = lat;
		this.lng = lng;
	}

	/**
	 * 
	 */
	public Addresses() {
		// TODO Auto-generated constructor stub
	}
}
